<script setup lang="ts">
import { ref } from "vue";
import router from "@/router";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useRoute } from "vue-router";

const multiTagsStore = useMultiTagsStoreHook();
const route = useRoute();

let form = ref({
  boundTypeName: "", // 出入库类型
  warehouseName: "", // 仓库名称
  boundCode: "", // 单据编号
  relateOrderTypeName: "", // 关联单类型
  relateOrderCode: "", // 关联单据号
  createName: "", // 操作人
  createTime: "", // 单据创建时间
  relateStockAbnormalCode: "", // 关联库存异动单号
  memo: "" // 备注
});

const goBack = () => {
  multiTagsStore.handleTags("splice", route.path);
  router.back();
};

const setForm = (opt: {}) => {
  form.value = opt || {};
}

defineExpose({
  getForm: () => form.value,
  setForm
});
</script>

<template>
  <div class="applyForm">
    <div class="flex items-center justify-between flex-row pb-[16px]">
      <p class="text-[16px] font-bold">出入库信息管理</p>
      <el-button @click="goBack"
        ><svg-icon name="rollback" size="16" />&nbsp;返回</el-button
      >
    </div>
    <el-descriptions class="mb-[-12px]">
      <el-descriptions-item label="出入库类型">
        {{ form.boundTypeName }}
      </el-descriptions-item>
      <el-descriptions-item label="仓库名称">
        {{ form.warehouseName }}
      </el-descriptions-item>
      <el-descriptions-item label="单据编号：">
        {{ form.boundCode }}
      </el-descriptions-item>
      <el-descriptions-item label="关联单类型：">
        {{ form.relateOrderTypeName }}
      </el-descriptions-item>
      <el-descriptions-item label="关联单据号：">
        {{ form.relateOrderCode }}
      </el-descriptions-item>
      <el-descriptions-item label="操作人：">
        {{ form.createName }}
      </el-descriptions-item>
      <el-descriptions-item label="单据创建时间：">
        {{ form.createTime }}
      </el-descriptions-item>
      <el-descriptions-item label="关联库存异动单号：">
        {{ form.relateStockAbnormalCode }}
      </el-descriptions-item>
      <el-descriptions-item label="备注：">
        {{ form.memo }}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<style scoped lang="scss">
.applyForm {
  overflow: hidden;
}
</style>
